﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace manySquares
{
    class Spaces
    {
        //write by parker and spencer
        private int land=0;
        private int owner = 0;
        private int building = 0;
        public int unitType = 0;
        public Unit unit;
        public Color color;
        public Rectangle rec;
        public Spaces(int iland, int iowner, int ibuilding, int iunitType,String iUnit)
        {
            land = iland;
            owner = iowner;
            building = ibuilding;
            unitType = iunitType;
            unit = new Unit(iUnit);
            rec = new Rectangle(1, 247, 40, 40);
            color = Color.White;
        }
        public void setUnit()
        {
            int type=1;
            if (type == 1)
                unit.setType("Builder");
            if (type == 2)
                unit.setType("Ranger");
            if (type == 3)
                unit.setType("Catapult");
            if (type == 4)
                unit.setType("Melee");
        }
        public void removeUnit()
        {
            unit.setType("None");
        }
        public Rectangle GetSourceRect()
        {
            if(unit.getType().Equals("Ranger"))
                return new Rectangle(1, 42, 40, 40);
            return rec;
        }
        public Color GetColor()
        {
            return color;
        }
        
    }
}
